/**
 * 2017年8月22日
 */
package exp.core;

/**
 * 线程私有
 * @author Alex
 *
 */
public class ThreadSafe<T> {
	private ThreadLocal<T> local;
	public ThreadSafe(ThreadLocal<T> local) {
		this.local = local;
	}
	/**
	 * @return
	 * @see java.lang.ThreadLocal#get()
	 */
	public T get() {
		return local.get();
	}
	/**
	 * @param value
	 * @see java.lang.ThreadLocal#set(java.lang.Object)
	 */
	public void set(T value) {
		local.set(value);
	}
	/**
	 * 
	 * @see java.lang.ThreadLocal#remove()
	 */
	public void remove() {
		local.remove();
	}
	/**
	 * @return
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return local.toString();
	}
}
